﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;//:)
using System.Net.Mail;//:)

/// <summary>
/// Summary description for SendEmail
/// </summary>
public class Send_Email
{

	#region "sendmail"
    public static void sendmail(string from, string to, string subject, string body)
    {
        try
        {
            MailMessage mailMsg = new MailMessage();
            mailMsg.From = new MailAddress(from, "BOOK_IDEAS_SHOP");
            mailMsg.To.Add(to);
            mailMsg.Subject = subject;
            mailMsg.IsBodyHtml = true;
            mailMsg.Body = body;
            mailMsg.Priority = MailPriority.Normal;
            SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
            NetworkCredential info = new NetworkCredential("thuongmaidientunhom14@gmail.com", "phanthikimloan");
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.Credentials = info;
            client.EnableSsl = true;
            client.Send(mailMsg);

        }
        catch (Exception)
        {

        }
    }
    #endregion

}